<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-yellow sidebar-mini">


<section class="content-header">
    <h1>电子转序单查询</h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <form id="queryForm" onsubmit="return false;">
                        <div class="row">
                            <div class="form-inline">
                                <div class="form-group">
                                    <label>项目号</label>
                                    <input type="text" name="prodNo" class="form-control" placeholder="请输入项目号">
                                </div>
                                <div class="form-group">
                                    <label>项目名</label>
                                    <input type="text" name="proName" class="form-control" placeholder="请输入项目名">
                                </div>
                                <div class="form-group">
                                    <label>图号</label>
                                    <input type="text" name="drawNo" class="form-control" placeholder="请输入图号">
                                </div>
                                <div class="form-group">
                                    <label>零件名称</label>
                                    <input type="text" name="drawName" class="form-control" placeholder="请输入零件名称">
                                </div>
                                <div class="form-group">
                                    <label>申请人</label>
                                    <input type="text" name="applyCode" class="form-control" placeholder="请输入申请人">
                                </div>
                                <div class="form-group">
                                    <label>质检人</label>
                                    <input type="text" name="checkCode" class="form-control" placeholder="请输入质检人">
                                </div>
                                <div class="form-group">
                                    <label>接收人</label>
                                    <input type="text" name="recCode" class="form-control" placeholder="请输入接收人">
                                </div>
                                <div class="form-group">
                                    <label for="query-groupName">状态</label>
                                    <select id="query-groupName" class="form-control" name="status">
                                        <option value="">请选择</option>
                                        <option value="1">待质检</option>
                                        <option value="2">已质检</option>
                                        <option value="3">已接收</option>
                                        <option value="4">被驳回</option>
                                        <option value="5">作废</option>
                                    </select>
                                </div>

                                <button type="button" class="btn btn-success" id="btn-search"
                                        onclick="js.table.search(table)">
                                    <span class="Bold">搜索</span>
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="box-body">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    let status = ["", "待质检", "已质检", "已接收", "被驳回", "作废"];
    let table;

    $(function () {

        /** 加载列表 */
        table = js.table.init({
            url: ctx + "flow/transquery/list",
            showExport: false,
            columns: [
                {
                    title: '序号', field: 'transId', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "生产令编号", field: 'prodNo'},
                {title: "项目名称", field: 'proName'},
                {title: "图号", field: 'drawNo'},
                {title: "零件名称", field: 'drawName'},
                {title: "工艺路线", field: 'route'},
                {title: "申请数量", field: 'num'},
                {title: "申请人", field: 'applyName'},
                {title: "质检人", field: 'checkName'},
                {title: "接收人", field: 'recName'},
                {title: "转序时间", field: 'checkTime'},
                {
                    title: "状态", field: 'status',
                    formatter: function (value, row) {
                        return status[value]
                    }
                },
                {
                    title: "操作",
                    width: '80',
                    formatter: function (value, row) {
                        let actions = [];
                        actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)"> 查看</a> ');
                        return actions.join('');
                    }
                }
            ]
        });
    });
</script>
</body>
</html>
